﻿<extend name="../Public/base" />
<block name="title">{$TITTLE}</block>
<block name="body">
<div id="tab-system" class="HuiTab">
    <div class="tabBar cl"><span>基本设置</span><span>URL规则设置</span></div>
    <div class="tabCon">
        <div class="mt-30"> </div>
        <form class="form form-horizontal" id="form-config-add" method="post">
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">URL模式：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <php>$url_models=array( "0"=>"普通模式", "1"=>"PATHINFO模式", "2"=>"REWRITE模式", "3"=>"兼容模式");</php>
                     <span class="select-box">
                        <select class="select" name="url_model">
                            <volist name="url_models" id="url_model">
                                <php>
                                    $url_model_selected=C('URL_MODEL')==$key?"selected":"";$html_suffix=C('URL_HTML_SUFFIX');</php>
                                 <option value="{$key}" {$url_model_selected}>{$url_model}</option>
                            </volist>
                        </select>
                     </span>
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">URL伪静态后缀：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" name="html_suffix" value="{$html_suffix}" class="input-text">
                </div>
            </div>
            <div class="row cl">
                <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                    <button class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
                    <button class="btn btn-default radius" type="reset">&nbsp;&nbsp;重置&nbsp;&nbsp;</button>
                </div>
            </div>
        </form>
    </div>
    <div class="tabCon">
        <form action="{:U('updateSort')}" method="post">
        <div class="mt-30"> </div>
        <div class="cl pd-5 bg-1 bk-gray">
            <span class="l">
                <a href="javascript:;" onclick="dels('route_id')" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
                <a href="javascript:;" onclick="layer_show('添加{$TITLE}','{:U("add")}','800','480')" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 添加</a>
            </span>
            <span class="r"><button class="btn btn-default radius" type="submit"><i class="Hui-iconfont">&#xe68f;</i> 更新排序</button></span>
        </div>
        <div class="mt-20">
            <table class="table table-border table-bordered table-bg">
                <thead>
                <tr class="text-c">
                    <th width="5%"><input type="checkbox" name="" value=""></th>
                    <th width="10%">ID</th>
                    <th width="25%">原始网址</th>
                    <th width="25%">显示网址</th>
                    <th width="5%">状态</th>
                    <th width="10%">排序</th>
                    <th width="20%">操作</th>
                </tr>
                </thead>
                <tbody>
                <volist name="list" id="info">
                    <tr class="text-c">
                        <td><input type="checkbox" name="route_id[]" value="{$info.route_id}"></td>
                        <td>{$info.route_id}</td>
                        <td>{$info.full_url}</td>
                        <td>{$info.url}</td>
                        <td>
                            <eq name='info.status' value='1'>
                                <span class="label label-success radius">已启用</span>
                                <else/>
                                <span class="label radius">已停用</span>
                            </eq>
                        </td>
                        <td>
                            <input name="sorts[{$info.route_id}]" value="{$info.sort}" type="text" class="input-text text-c"  style="width: 120px" />
                        </td>
                        <td class="f-14">
                            <eq name='info.status' value='1'>
                                <a  onclick="change_status('{$info.route_id}')" href="javascript:;" title="启用"><i class="Hui-iconfont">&#xe631;</i></a>
                                <else/>
                                <a  onclick="change_status('{$info.route_id}')" href="javascript:;" title="禁用"><i class="Hui-iconfont">&#xe615;</i></a>
                            </eq>
                            <a title="编辑" href="javascript:;" onclick="layer_show('编辑{$TITLE}','{:U('edit',array('route_id'=>$info['route_id']))}','800','480')" class="ml-5">
                                <i class="Hui-iconfont">&#xe6df;</i>
                            </a>
                            <a title="删除" href="javascript:;" onclick="del('{$info.route_id}','route_id')" class="ml-5">
                                <i class="Hui-iconfont">&#xe6e2;</i>
                            </a>
                        </td>
                    </tr>
                </volist>
                </tbody>
            </table>
        </div>
        <div class='paging_simple_numbers'>{$page}</div>
    </form>
    </div>
</div>
</block>
<block name="js">
    <script type="text/javascript">
        function change_status(id) {
            action('确认要改变状态吗？',id,"{:U('changeStatus')}",'route_id');
        }
    </script>
    <script type="text/javascript">
        $(function(){
            $.Huitab("#tab-system .tabBar span","#tab-system .tabCon","current","click","{$tab|default='1'}");
        });
    </script>
</block>